<template>
	<view class="container">
		<view class="flex diygw-col-24 justify-start flex-nowrap flex-clz">
			<view class="flex diygw-col-3 avatar-clz">
				<view @tap="navigateTo" data-type="page" data-url="/pages/youxuanxiangmu" class="diygw-avatar sm white radius">
					<text class="diy-icon-back_android"></text>
				</view>
			</view>
			<view class="diygw-col-24 text7-clz"> 项目互动 </view>
		</view>
		<view v-for="(item, index) in project.data.list" :key="index" class="flex diygw-col-24 justify-around flex-nowrap flex7-clz" @tap="navigateTo" data-type="page" data-url="/pages/xiangmuxiangqing">
			<view class="flex diygw-col-0 justify-center">
				<view v-for="(item, index) in project.data.list" :key="index" class="diygw-avatar xs radius bg-none">
					<image mode="aspectFit" class="diygw-avatar-img radius" :src="item.picture_"></image>
				</view>
			</view>
			<view class="flex diygw-col-24 flex-direction-column justify-start flex-wrap flex1-clz">
				<view class="flex flex-wrap diygw-col-0 flex2-clz">
					<view class="diygw-col-0 text-clz">
						{{ item.project_name_ }}
					</view>
					<view class="diygw-col-0">
						{{ item.project_type_ }}
					</view>
				</view>
				<view class="flex flex-wrap diygw-col-0 flex3-clz">
					<view class="diygw-col-0 text2-clz">
						{{ item.need_type_ }}
					</view>
					<view class="diygw-col-0">
						{{ item.type_value_ }}
					</view>
				</view>
				<view class="flex flex-wrap diygw-col-0 flex4-clz">
					<view class="diygw-col-0 text4-clz">
						{{ item.need_detail_ }}
					</view>
					<view class="diygw-col-0">
						{{ item.detail_value_ }}
					</view>
				</view>
			</view>
			<view class="flex diygw-col-0 justify-end items-end flex-nowrap flex5-clz">
				<view class="flex diygw-col-0 justify-end avatar2-clz">
					<view class="diygw-avatar xs radius">
						<text class="diy-icon-commentfill"></text>
					</view>
				</view>
				<view class="diygw-col-0 text6-clz"> 256 </view>
			</view>
		</view>
		<view class="clearfix"></view>
	</view>
</template>

<script>
	//create by: 邓志锋 <280160522@qq.com> <https://www.diygw.com> DIYGW可视化设计一键生成源码
	export default {
		data() {
			return {
				//用户全局信息
				userInfo: {},
				project: {
					code: '200',
					data: {
						count: 7,
						list: [
							{
								project_type_: '教育业',
								user_phone_: '123',
								project_id_: '434440356570595329',
								user_name_: '用户1',
								detail_value_: '500',
								id_: '434440356570595329',
								type_value_: '5%股份',
								project_status: '优选发布',
								need_detail_: '椅子',
								project_name_: '作业帮',
								user_id_: '434443664980705281',
								project_paper_: '',
								need_type_: '人才',
								picture_: 'image1',
								project_desc_: '好项目'
							},
							{
								project_type_: '食品业',
								user_phone_: '123',
								project_id_: '434554158620868609',
								user_name_: '用户2',
								detail_value_: '500',
								id_: '434554158620868609',
								type_value_: '4%股份',
								project_status: '优选发布',
								need_detail_: '桌子',
								project_name_: '汇源果汁',
								user_id_: '434443977751527425',
								need_type_: '人才',
								picture_: 'image2',
								project_desc_: '真好喝'
							},
							{
								project_type_: '科技业',
								user_phone_: '222',
								project_id_: '434559619204907009',
								user_name_: '用户3',
								detail_value_: '100',
								id_: '434559619204907009',
								type_value_: '10%股份',
								project_status: '优选发布',
								need_detail_: '电脑',
								project_name_: '华为项目',
								user_id_: '434443977751527426',
								need_type_: '人才',
								picture_: 'image3',
								project_desc_: '项目简介项目简介'
							},
							{
								project_type_: '教育业',
								user_phone_: '123',
								project_id_: '434559717528043521',
								user_name_: '用户4',
								detail_value_: '100',
								id_: '434559717528043521',
								type_value_: '7%股份',
								project_status: '成交',
								need_detail_: '打印机',
								project_name_: '作业帮2',
								user_id_: '434444372742504449',
								need_type_: '人才',
								picture_: 'image4',
								project_desc_: '项目简介项目简介'
							},
							{
								project_type_: '食品业',
								user_phone_: '123',
								project_id_: '434559825713037313',
								user_name_: '用户1',
								detail_value_: '200',
								id_: '434559825713037313',
								type_value_: '8%股份',
								project_status: '成交',
								need_detail_: '桌子',
								project_name_: '汇源果汁2',
								user_id_: '434443664980705281',
								project_paper_: '',
								need_type_: '人才',
								picture_: 'image5',
								project_desc_: '项目简介项目简介'
							},
							{
								project_type_: '食品业',
								user_phone_: '123',
								user_id_: '434444372742504449',
								user_name_: '用户4',
								id_: '434559825713037314',
								project_status: '成交',
								picture_: 'image4',
								project_desc_: '项目简介',
								project_name_: '汇源果汁3'
							},
							{
								id_: '434559825713037315',
								project_name_: '汇源果汁4'
							}
						]
					},
					isOk: true
				}
			};
		},
		onShow() {
			this.setCurrentPage(this);
		},
		onLoad(option) {
			this.setCurrentPage(this);
			if (option) {
				this.setData({
					globalOption: this.getOption(option)
				});
			}

			this.init();
		},
		methods: {
			async init() {
				await this.projectApi();
			},
			// 项目列表接口 API请求方法
			async projectApi() {
				let project = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_projectList',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: '{"curPage":1,"pageSize":"10","params":"{}"}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.project = project;
			}
		}
	};
</script>

<style lang="scss" scoped>
	.flex-clz {
		flex: 1;
	}
	.avatar-clz {
		padding-top: 7px;
		font-weight: bold;
		padding-left: 0px;
		font-size: 16px;
		padding-bottom: 0px;
		padding-right: 0px;
	}
	.text7-clz {
		margin-left: 5px;
		padding-top: 10px;
		font-weight: bold;
		padding-left: 0px;
		width: calc(100% - 5px - 5px) !important;
		padding-bottom: 0px;
		margin-top: 5px;
		margin-bottom: 5px;
		text-align: center;
		margin-right: 5px;
		padding-right: 0px;
	}
	.flex7-clz {
		border: 1px solid #eee;
		padding-top: 0px;
		border-bottom-left-radius: 6px;
		padding-left: 0px;
		padding-bottom: 0px;
		border-top-right-radius: 6px;
		margin-right: 5px;
		margin-left: 5px;
		box-shadow: 0px 1px 3px rgba(31, 31, 31, 0.16);
		overflow: hidden;
		width: calc(100% - 5px - 5px) !important;
		border-top-left-radius: 6px;
		margin-top: 20px;
		border-bottom-right-radius: 6px;
		margin-bottom: 5px;
		padding-right: 0px;
	}
	.flex1-clz {
		margin-left: 15px;
		width: calc(100% - 15px - 5px) !important;
		margin-top: 5px;
		margin-bottom: 5px;
		margin-right: 5px;
	}
	.text-clz {
		font-weight: bold;
	}
	.text2-clz {
		font-weight: bold;
	}
	.text4-clz {
		font-weight: bold;
	}
	.avatar2-clz {
		margin-left: 5px;
		background-size: 100% 100%;
		margin-top: 15px;
		margin-bottom: 5px;
		margin-right: 0px;
	}
	.text6-clz {
		margin-left: 5px;
		margin-top: 5px;
		margin-bottom: 10px;
		margin-right: 5px;
	}
	.container {
		padding-left: 0px;
		padding-right: 0px;

		font-size: 12px;
	}
	.container {
	}
</style>
